package com.example.soss.entity;

import lombok.AllArgsConstructor;

@AllArgsConstructor
public enum ResultEnum {
    SUCCESS(200, "选课成功！"),
    FAILURE(1, "选课失败！"),
    REPEAT(2, "每个人只能选择一门课！"),
    EMPTY(3, "该课程已被选完！"),
    LIMIT(4, "访问太频繁，请稍后再试！"),
    QUEUING(5, "排队中..."),
    ERROR(500, "服务器发生错误！"),
    LOGIN_SUCCESS(200, "登录成功！"),
    LOGIN_FAILURE(0, "用户名或密码错误！"),
    VERIFY_CODE_ERROR(1, "验证码错误"),
    NOT_LOGIN(401, "请先登录！"),
    ACCESS_DENIED(403, "没有权限！"),
    DROP_SUCCESS(200, "退课成功！"),
    DROP_FAILURE(4, "退课失败，您不存在该选课记录！"),
    ADD_SUCCESS(200, "添加成功！"),
    ADD_FAILURE(1, "添加失败，该课程已经存在！"),
    DELETE_SUCCESS(200, "删除成功！"),
    DELETE_FAILURE(1, "删除失败，该课程不不存在！"),
    UPDATE_FAILURE(1, "更新失败，该课程已经存在！"),
    UPDATE_SUCCESS(200, "更新成功！"),
    WAIT(6, "当前页面访问人数过多，请稍后再试");



    private final int code;
    private final String msg;

    public String msg() {
        return msg;
    }
    public int code() {
        return code;
    }

}
